#include "typedef.h"
#include "systick.h"
#include "config.h"


static uint32_t hb_time = 0;
static uint32_t add_time = 0;

void reset_hb_time(void){
	reset_ltime(&hb_time);
}

void reset_add_time(void){
	reset_ltime(&add_time);
}

void check_wifi(void){
	if(is_ltime_out(add_time, min(2))){
		__CF_ADD_DEVICE = 0;
	}
	if(is_ltime_out(hb_time, min(5))){
		__CF_WIFI_STATUS = 0;
	}
}

void wifi_func(void){
	check_wifi();
}